package com.huadi.ssm.controller;

import com.huadi.ssm.po.User;
import com.huadi.ssm.service.UserService;
import com.huadi.ssm.service.UserServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;


@Controller
public class UserController {

    @Autowired
    private UserService userService;

    @RequestMapping("/hello")
    public String list(Model model){

        List<User> userList = userService.findAll();
        model.addAttribute("users",userList);
        return "hello";
    }
}
